package com.insleton.admin.user.controller;

import com.google.common.collect.Lists;
import com.insleton.admin.user.model.Reply;
import com.insleton.admin.user.model.User;
import org.apache.logging.log4j.LogManager;
import org.apache.logging.log4j.Logger;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

/**
 * 用户信息控制器，用来和vben前端来对接的
 */
@RestController
@RequestMapping("/user")
public class UserController {
    private static final Logger LOGGER = LogManager.getLogger(UserController.class);

    @RequestMapping("/info")
    public Reply<User> info() {
        User user = new User();
        user.setId(0);
        user.setRealName("Vben");
        user.setUsername("vben");
        List<String> roles = Lists.newArrayList("super");
        user.setRoles(roles);
        return Reply.success("success", user);
    }

    // @RequestMapping("/info")
    // public User info() {
    //     User user = new User();
    //     user.setId(0);
    //     user.setRealName("Vben");
    //     user.setUsername("vben");
    //     List<String> roles = Lists.newArrayList("super");
    //     user.setRoles(roles);
    //     return user;
    // }
}
